<%@ page contentType="text/html;charset=utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
	<title>首页</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#tmd").attr("value","tmd");
			$("#searchForm").validate({
				rules: {tableSchema: "required"}
			});
			$("#tableSchema").select2();
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
    <div class="row">
    	<div class="col-md-8 col-md-offset-2">
    		<form:form id="searchForm" modelAttribute="tableState" action="${ctx}/list" method="get" class="form-inline">  			
    			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
   				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
   				<div class="form-group">
   			        <label for="tableSchema">请选择数据库</label>
	   				<form:select path="tableSchema" class="input-sm">
	   					<form:option value="" label="请选择"/>
	   					<form:option value="saofu" label="saofu"/>
	   					<form:option value="mp" label="mp"/>
	   					<form:option value="dining" label="dining"/>
	   					<form:option value="hop" label="hop"/>
	   					<form:option value="opendb" label="opendb"/>
	   					<form:option value="monitor" label="monitor"/>
	   				</form:select>
	   				<span class="help-inline"><font color="red">*</font></span>&nbsp;&nbsp;
   				</div>
				<div class="form-group">
	   				<label for="createTime">日期</label>
	   				<form:input path="createTime" type="text" readonly="readonly" class="Wdate form-control input-sm"
						onclick="WdatePicker({dateFmt:'yyyyMMdd',isShowClear:false});"/>
	   				<button id="query" class="btn btn-primary btn-xs" type="submit">查询</button>&nbsp;  
	   				<span class="help-inline">没找到数据库？请点击&nbsp;<a href="#">更新</a></span>									
				</div>	
    		</form:form>
    	</div>
    </div>
    <div class="row">
    	<div class="col-md-8 col-md-offset-2">
    		<table id="contentTable" class="table table-striped table-bordered table-condensed">
    			<thead><tr><th>表名</th><th>数据量</th><th>时间</th><th>操作</th></tr></thead>
    			<tbody>
    			<c:forEach items="${page.list}" var="table">
    				<tr>
    					<td>${table.tableName}</td>
    					<td>${table.tableRows}</td>
    					<td>${fnc:intToDate(table.createTime)}</td>
    					<td><a href="${ctx}/show/increment?tableSchema=${table.tableSchema}&tableName=${table.tableName}&createTime=${table.createTime}" target="_blank">查看增量</a></td>
    				</tr>
    			</c:forEach>
    			</tbody>	
    		</table>
    	</div>
    </div>
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			 <div class="pagination">${page}</div>
		</div>	
	</div>  
   
</body>
</html>